package com.paradox.aggregation.gateway.config;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.Properties;

@Data
@ConfigurationProperties("spring.cloud.gateway.routes-config")
public class DynamicRouteSourceProperties {
    private String serverAddr;
    private String dataId;
    private String groupId;
    @Value("${spring.cloud.gateway.routes-config.file-extension}")
    private String fileExtension;

    public Properties build(){
        Properties properties=new Properties();
        properties.put("serverAddr",serverAddr);
        properties.put("dataId",dataId);
        properties.put("groupId",groupId);
        properties.put("fileExtension",fileExtension);
        return properties;
    }
}
